package main

import (
	"fmt"
	"reflect"
)

func main() {
	// get type and value of an interface{}
	var i interface{} = 10
	t := reflect.TypeOf(i)
	fmt.Println("type of v is", t)
	v := reflect.ValueOf(i)
	fmt.Println("value of v is", v)
	// set value of an interface{}
	j := 10
	p := reflect.ValueOf(&j)
	p.Elem().SetInt(20)
	fmt.Println("value of j is", j)
}
